#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@NAME          : api_response.py
@TIME          : 2025/03/09 17:27:30
@AUTHOR        : chenlip
@VERSION       : 0.0.1
@DESCRIPTION   : 统一的错误响应类
'''
# --------------------------引用--------------------------
import os
# --------------------------引用--------------------------

class ApiResponse:
    @staticmethod
    def success(data=None, message="操作成功"):
        return {
            "success": True,
            "code": "00000",
            "message": message,
            "data": data
        }
    
    @staticmethod
    def error(message, code="E0001", data=None):
        return {
            "success": False,
            "code": code,
            "message": message,
            "data": data
        }
